package com.am.servlet;

import com.am.service.MenuCheckService;
import com.utils.Meg;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class MenuCheckServlet {
    @Autowired
    private MenuCheckService menuCheckService;
    @RequestMapping("/menuCheckView")
    public String menuView(){
        return "check/menuCheck";
    }
    @ResponseBody
    @RequestMapping("/menuJson")
    public List menuJson(@Param("id") Integer id){
        return menuCheckService.getMenuJsonDate(id);
    }
    @RequestMapping("/menuCheck")
    @ResponseBody
    public Meg menuCheck(@Param("roleId")Integer roleId, @Param("menuId") Integer[] menuId){
        return menuCheckService.menuCheck(roleId,menuId);
    }
}
